using System;

namespace PropertyExpression.ReactiveRelation
{
    public static class ActionExtensions
    {
        public static void OverloadCall<TCalcContext, TEntity, TProperty>(
            this Action<Func<IPropertyBindContext<TCalcContext, TEntity, TProperty?>, IValue<TProperty?>>> action,
            Func<IPropertyBindContext<TCalcContext, TEntity, TProperty?>, IValue<TProperty>> func)
            where TProperty : struct
        {
            action(arg => func(arg).ToNullable());
        }
    }
}